import { Domain } from '@/constants';
/**
 * checkEmail
 */
export const isEmail = (mail) => {
  const rePass = new RegExp('^([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+\\.[a-zA-Z]{2,3}$', '');
  return rePass.test(mail);
};

export const isLogin = () => {
  return !!localStorage.getItem('TOKEN');
};

/**
 * 补全图片地址
 */
export const getImgUrl = (url) => {
  return Domain + url;
};
